package org.luxor.cloud.authentication.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;

import java.util.Date;
import java.io.Serializable;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.luxor.commons.core.validator.group.UpdateGroup;


/**
 * 客户端详情
 *
 * @author sunlightcs @date 2020-10-18 21:19:26
 */
@Data
@TableName("tb_oauth_client_details")
@ApiModel(description = "客户端详情")
public class OauthClientDetailsEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@TableId(type = IdType.ID_WORKER)
	@ApiModelProperty(value = "主键Id")
	@JSONField(serializeUsing = ToStringSerializer.class)
	@NotNull(message = "id，不能为空", groups = UpdateGroup.class)
	private Long id;

	@ApiModelProperty(value = "租户ID")
	@JSONField(serializeUsing = ToStringSerializer.class)
	private Long tenantId;

	@ApiModelProperty(value = "客户端ID")
	@NotBlank(message = "clientId，不能为空")
	private String clientId;

	@ApiModelProperty(value = "客户端密码")
	private String clientSecret;

	@ApiModelProperty(value = "客户端名称")
	private String clientName;

	@ApiModelProperty(value = "权限范围('basics', 'user_details', 'party')")
	private String scope;

	@ApiModelProperty(value = "授权类型('authorization_code', 'implicit', 'password', 'client_credentials', 'refresh_token')")
	private String authorizedGrantTypes;

	@ApiModelProperty(value = "重定向URI")
	private String webServerRedirectUri;

	@ApiModelProperty(value = "权限码")
	private String authorities;

	@ApiModelProperty(value = "访问令牌的有效性(0-无效；1-有效)")
	private Boolean accessTokenValidity;

	@ApiModelProperty(value = "刷新令牌的有效性(0-无效；1-有效)")
	private Boolean refreshTokenValidity;

	@ApiModelProperty(value = "额外信息(json格式)")
	private String additionalInformation;

	@ApiModelProperty(value = "自动批准")
	private String autoApprove;

}
